package com.giscloud.amp.controller.regis;

import com.giscloud.amp.controller.BaseController;
import com.giscloud.amp.entity.regis.dto.AreaDTO;
import com.giscloud.amp.service.regis.AreaService;
import com.giscloud.datasource.page.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:gxd
 * @Description:行政区域
 * @Date: 17:24 2018/2/24
 * @Modified By:
 */
@SuppressWarnings("SpringJavaAutowiringInspection") //加这个注解让IDE 不报: Could not autowire
@RestController
public class AreaController extends BaseController {
    @Autowired
    private AreaService areaRemoteClient;

    /**
     * 根据名称获取行政区域,分页
     * @return
     */
    @RequestMapping("/amp/area/findPageAreaByName")
    public PageInfo findPageAreaByName(@RequestBody AreaDTO areaDTO){
        return areaRemoteClient.findPageAreaByName(areaDTO);
    }

    /**
     * 获取城市列表,额外两值 gatherMap 采集资源数据, regisMap 楼盘资源数据
     * @return
     */
    @RequestMapping("/amp/area/findAreaMapByName")
    public PageInfo findAreaMapByName(@RequestBody AreaDTO areaDTO){
        return areaRemoteClient.findAreaMapByName(areaDTO);
    }

}
